﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Wings.Web.Domain;
using Wings.Web.Repostory;

namespace Wings.Web.Controllers
{
    public class BookController:ApiController
    {
        IBookRepostory BookRepostory;
        public BookController(IBookRepostory _bookRepostory)
        {
            BookRepostory = _bookRepostory;
        }
        public List<Book> Get()
        {
            Book book = new Book();
            book.Name = "三体";
            book.Price = 50.41M;
            BookRepostory.Create(book);
            book.Price = 49.41M;
            BookRepostory.Update(book);
            BookRepostory.Comment();
            var result= BookRepostory.Query(b=> b.Name== "三体").ToList();
           //BookRepostory.Delete(book.ID);
            return result;
        }
    }
}
